static unsigned long get_syscall_table_ia32(void)
{/*{{{*/
#define OFFSET_SYSCALL 100    /* from system_call/ia32_syscall, we'll read first 150 bytes */

    struct idtr idtr;
    struct idt idt;

    unsigned long sys_call_off;
    unsigned long retval;

    char sc_asm[OFFSET_SYSCALL], *p;




    /* well, let's read IDTR */
    asm("sidt %0"
        :"=m"(idtr)
        : );

    dbgprint("idtr base at %p\n", (void *)idtr.base);

    /**
     * Read in IDT for vector 0x80 (syscall) 
     */
    memcpy(&idt, (char *) idtr.base + 16 * 0x80, sizeof(idt)); 
    sys_call_off =  ( ( (unsigned long)idt.offset_high ) << 32 ) | 
        ( ((idt.offset_middle << 16 ) | idt.offset_low) & 0x00000000ffffffff ); 
    dbgprint("sys_call_off at %p\n", (void *)sys_call_off);

    /* we have syscall routine address now, look for syscall table
       dispatch (indirect call) */
    memcpy(sc_asm, (void *)sys_call_off, OFFSET_SYSCALL);
    
     p = (char *) memmem(sc_asm, OFFSET_SYSCALL, "\xff\x14\xc5", 3);
    if (p == NULL) {
        printk("opcode not found, meats that we cannot find sys_call_table.\n");
        return 0;
    }

    retval = *(unsigned long *) (p + 3);
    return retval;
#undef OFFSET_SYSCALL
}/*}}}*/
    